<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\UserContext;
use App\Http\Services\ProjectService;
use App\Http\Traits\ResponseJson;

class ProjectController extends Controller
{
    use ResponseJson;

    protected $projectService;

    public function __construct(ProjectService $projectService)
    {
        $this->projectService = $projectService;
    }

    /**
     * 轻列表
     * @return \Illuminate\Http\JsonResponse
     */
    public function softLists()
    {
        $data = $this->projectService->softLists();
        return $this->returnJson($data);
    }

    /**
     * 轻详情
     * @return \Illuminate\Http\JsonResponse
     */
    public function softDetail()
    {
        $data = $this->projectService->softDetail();
        return $this->returnJson($data);
    }

    /**
     * 调研中心
     * @param UserContext $userContext
     * @return \Illuminate\Http\JsonResponse
     */
    public function lists(UserContext $userContext)
    {
        $data = $this->projectService->lists($userContext);
        return $this->returnJson($data);
    }

    /**
     * 项目搜索
     * @return \Illuminate\Http\JsonResponse
     */
    public function searchLists()
    {
        $data = $this->projectService->searchLists();
        return $this->returnJson($data);
    }

    /**
     * 项目扫街列表
     * @return \Illuminate\Http\JsonResponse
     */
    public function sweepList()
    {
        $data = $this->projectService->sweepList();
        return $this->returnJson($data);
    }
}
